import cv2
import numpy as np

def main():
    img = cv2.imread('3/lena_color.jpg')
    if img is not None:
        # print(img.shape[0:2])
        x = 100
        y = 200
        h, w = img.shape[0:2]
        M = np.float32([[1., 0., x],
                        [0., 1., y]])
        img1 = cv2.warpAffine(img, M, (h, w))

        cv2.imshow('img', img)
        cv2.imshow('img1', img1)
        cv2.waitKey(0)
        cv2.destroyAllWindows()
    else:
        print('failed to load img')


if __name__ == '__main__':
    main()